<template>
    <div class="sign-up-info">
        <div class="search-content">
            <span style="font-size: 14px;margin-left: 10px;">业务类型：</span>
            <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
            <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
            <el-checkbox v-for="(city,i) in cities" :label="city.value" :key="i" >{{city.label}}</el-checkbox>
            </el-checkbox-group>
           
            <div class="time-range-wrapper" >
                <span class="time-range-label">交易时间：</span>
                <el-date-picker
                        v-model="searchContent.addTime"
                        type="daterange"
                        range-separator="至"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期">
                </el-date-picker>
            </div>
            <span style="font-size: 14px;margin-left: 10px;" class="time-range-label">交易金额：</span>
            <el-input class="search-content-input" v-model="searchContent.userName" ></el-input>~
            <el-input class="search-content-input" v-model="searchContent.userPhone" ></el-input>
            <!-- <el-input class="search-content-input" v-model="searchContent.store_name" placeholder="请输入店铺名称"></el-input> -->
            <!-- <el-input class="search-content-input" v-model="searchContent.signUpChannel" placeholder="请输入报名渠道"></el-input> -->
            <!-- <el-input style="width: 0;visibility: hidden;" class="search-content-input" v-model="searchContent.employeeName" placeholder="请输入员工姓名"></el-input> -->
            <el-select v-model="searchContent.signUpChannel" placeholder="请选择对账状态">
                <el-option
                        v-for="item in channelList"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                </el-option>
            </el-select>
            <el-select v-model="searchContent.payStatus" placeholder="请选择支付类型">
                <el-option
                        v-for="item in payStatusList"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                </el-option>
            </el-select>
            <el-select v-model="searchContent.cdkey_state" placeholder="请选择交易状态">
                <el-option
                        v-for="item in statelist"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                </el-option>
            </el-select>
            <!-- <span style="font-size: 14px;margin-left: 10px;"class="time-range-label">订单搜索：</span> -->
            <el-select v-model="searchContent.oder_state" placeholder="请选择订单类型">
                <el-option
                        v-for="item in oderlist"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                </el-option>
            </el-select>
           
            <el-input class="search-content-input" v-model="searchContent.effective_day" placeholder="请输入订单编号" 
             prop="searchContent.effective_day"></el-input>
            <el-button type="primary" @click="search">搜索</el-button>
            <el-button type="primary" @click="resetSearchData">重置</el-button>
        </div>
        <div class="search-list">
            <el-table :data="signUpInfoList" border :height="oHeight">
                <el-table-column
                        align="center"
                        prop="pay_type_name"
                        label="订单类型"
                        min-width="80"></el-table-column>
                <el-table-column
                        align="center"
                        prop="pay_ordersn"
                        label="第三方支付单号"
                        min-width="120"></el-table-column>
                <el-table-column
                        align="center"
                        prop="third_amount"
                        label="第三方交易金额"
                        min-width="120">
                    <template  slot-scope="scope">
                            {{scope.row.third_amount}}
                    </template>        
                </el-table-column>
                <el-table-column
                        align="center"
                        label="业务类型"
                        prop="business_type_name"
                        min-width="120">
                </el-table-column>
                <el-table-column
                        align="center"
                        prop="ordersn"
                        label="支付订单号"
                        min-width="90">
                </el-table-column>
                <el-table-column
                        align="center"
                        prop="amount"
                        label="交易金额"
                        min-width="90">
                        
                </el-table-column>
                <el-table-column
                        align="center"
                        label="交易状态"
                        prop="pay_order_state_name"
                        min-width="120">
                       
                </el-table-column>
                <el-table-column
                        align="center"
                        prop="pay_time"
                        label="交易时间"
                        min-width="90">
                       
                </el-table-column>
                <el-table-column
                        align="center"
                        prop="poundage"
                        label="手续费"
                        min-width="90">
                </el-table-column>
                <el-table-column
                        align="center"
                        prop="poundage_rate"
                        label="费率"
                        min-width="90">
                   
                </el-table-column>
                    <el-table-column
                            align="center"
                            prop="state_name"

                            label="对账状态"
                            min-width="120">
                        
                    
                    </el-table-column>
                    <el-table-column
                    align="center"
                    prop="store_name"
                    label="所属商家"
                    min-width="90">
            
                  </el-table-column>
                <el-table-column
                    align="center"
                    prop="package_id"
                    label="所属包ID"
                    min-width="120"> 
                </el-table-column>                
                <el-table-column
                    align="center"
                    prop="is_ok_manual"
                    label="操作"
                    min-width="120"
                >
                    <template  slot-scope="scope">
                            <el-button v-if="scope.row.is_ok_manual==0"    type="primary"  @click="reconciliation(scope.row.id)">手动对账</el-button>
                    </template>          
                </el-table-column>        
            </el-table>
            <div class="bottom paginationOne">
                <div style="display: flex;
                justify-content: space-between;
                align-items: center;"> 
                <el-upload
                    class="upload-demo"
                            action="#"
                            :auto-upload="false"
                            :on-change="(val, list) => {codeChange(val, list);}">
                <el-button type="primary">同步银行流水</el-button>
                </el-upload>
                <el-button style="margin-left: 20px;" type="primary" @click="reconcide">对账</el-button>
                <el-button type="primary" style="margin-left: 20px;" @click="newoder">生成打款单</el-button>
                <el-button type="primary" style="margin-left:20px;" @click="exportLink">导出打款清单</el-button>
                <el-button type="primary" style="margin-left:20px;" @click="onlyexport">导出</el-button>
                <!-- <div class="btn-group" >
                    <el-button type="primary" @click="synchronization">同步银行流水</el-button>
                </div>
                <div class="btn-group" >
					<el-button type="primary" style="margin-left: 10%;" @click="newoder">生成打款单</el-button>
                  <a class="btn-bottom" >新增项目券</a> 
                </div> -->
            </div>
               
                <div>
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="searchContent.currentPage"
                            :page-sizes="[10, 20, 50, 100]"
                            :page-size="searchContent.pageSize"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="total">
                    </el-pagination>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import {dateFormatter,objScreen} from "../../../../common/js/util";
	import { resize } from "@/common/js/height.js";
	import Qs from 'qs';
    import XLSX from "xlsx";
    import Tinymce from '@/components/Tinymce';
	export default {
		data() {
			return {
                form:{
                    csv: '',
                },
                uploadData:{
				  img_source:'attach_pointprod'
			    },
                checkAll: false,
                cities: [], //数据源
                checkedCities:[], //绑定默认选中
                isIndeterminate:false, //设置 indeterminate 状态，只负责样式控制
				payStatusList: [],
                statelist: [
					{label: '成功 ', value: 1},
					{label: '退款', value: 2},
                ],
                oderlist: [
					{label: '第三方订单号 ', value: "pay_ordersn"},
					{label: '支付订单号', value: "ordersn"},
                   
                ],
                addArr:[],
                list:[],
                channelList: [
                    {label: '未对账', value: 0},
                    {label: '对账通过 ', value: 1},
					{label: '金额不匹配', value: 2},
                    {label: '订单不存在', value: 3},
                    {label: '状态不匹配', value: 4},
                    {label: '对账通过,已退款', value: 5},
                ],
				oHeight: 600,
				searchContent: {
					groupName: '',
					userName: '',
					userPhone: '',
					payStatus: '',
                    signUpChannel: '',
                    addTime: '',
                    employeeName: '',
                    pay_channel:2,
				},
				signUpInfoList: [],
				total: 0
			}
        },
        components: {Tinymce, XLSX},
		computed: {

		},
		methods: {
            codeChange(val, list) {
                console.log('>>>', val.raw)
                this.form.csv = val.raw;
                
                let fd = new FormData();
                fd.append("csv", this.form.csv);
            
                    console.log("fd",fd);
                    this.$http.post('/admin/adminImports/index.php?act=reconciliationImport&op=run', fd).then(res => {
                        if (res.code == 1) {
                        this.$message.success(res.msg);
                    // this.$http.post('/admin/bill/index.php?act=reconciliation&op=reconciliation').then(res => {
                    //     if (res.code == 1) {
                    //         this.$message.success(res.msg);
                    //     }
                    //     else {
                    //         this.$message.error(res.msg);
                    //     }
                    // })
                        }
                        else {
                            this.$message.error(res.msg);
                        }
                    })
            },
            //手动对账
            reconciliation(id){
               this.$confirm('确定要手动对账吗？')
                .then(_ => {
                    this.$http.post('/admin/bill/index.php?act=reconciliation&op=reconciliationManual&id='+id).then(res => {
                        if (res.code == 1) {
                             this.$message.success(res.msg);
                             this.getListData();
                        }
                        else {
                             this.$message.error(res.msg);
                        }
                    })                    
                })
            },            
            synchronization(){
            },
            newoder(){
            this. getPackageListData(); 
            },
            // 全选 --- 当绑定值变化时触发的事件
            handleCheckAllChange(val) {
                console.log(val) //val的值是一个布尔值，点中全选为false，取消全选为true
                this.cities.forEach(item=>{  //当全选被选中的时候，循环遍历源数据，把数据的每一项加入到默认选中的数组去
                this.checkedCities.push(item.value)
                })  
                this.checkedCities = val ? this.checkedCities : []; //三元表达式，如果val的值为true，那么就把当前默认选中的值赋值给自身，这样页面页面上所有的元素就都选中了。如果为false，就是取消全选
                this.isIndeterminate = false;  //官网说这是个样式控制，是来控制，什么时候半选的，要不要都无所谓，看你需求
                console.log(this.checkedCities)
            },
        // checkbox选中 --- 当绑定值变化时触发的事件
            handleCheckedCitiesChange(value) {
                let checkedCount = value.length;   //选中值的长度
                this.checkAll = checkedCount === this.cities.length;  //如果选中值的长度和源数据的长度一样，返回true，就表示你已经选中了全部checkbox，那么就把true赋值给this.checkAll
                this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length; //同全选按钮事件里面的那个样式控制
                console.log(this.checkedCities)
            },
          

			refund(item) {
				// this.$http.post('/admin/afterSalesGroupBuy/index.php?act=signup&op=returnMoney', {
				// 	id: item.id
                // }).then(res => {
                // 	if (res.code == 1) {
                //         item.payStatus = 3;
                //     } else {
                // 		alert(res.msg);
                //     }
                // })
            },
           
            computedCheckStatus(code) {
                
				switch (code*1) {
					case 1:
						return '未使用';
					case 3:
						return '已过期';
					case 2:
                        return '已使用';
                    case 4:
						return '已失效';
					case 5:
						return '未激活';	
                    case 9:
                        return '9';
                    case 11:
                        return '11';
                    case 12:
                        return '22';
                    case 999:
						return '999';
				}
			},
            
			resetSearchData() {
				this.searchContent.groupName = '';
				this.searchContent.userName = '';
                this.searchContent.userPhone = '';
                this.searchContent.store_name = '';
                this.searchContent.effective_day = '';
				this.searchContent.payStatus = '';
                this.searchContent.cdkey_state = '';
                this.searchContent.oder_state = '';
				this.searchContent.signUpChannel = '';
                this.searchContent.employeeName = '';
                this.searchContent.addTime = '';
                this.searchContent = [];
                this.checkedCities = [];
                this.isIndeterminate = false;
                this.getListData();
			},
            //获取支付类型
            getPaystate(){
				this.$http.post('/admin/bill/index.php?act=reconciliation&op=getOrdersTypes').then(res => {
                	if (res.code == 1) {
                        this.payStatusList = res.data;
                    } else {
                		alert(res.msg);
                    }
                })
            },
			search() {
				this.searchContent.currentPage = 1;
				this.getListData();
			},
			handleSizeChange(pageSize) {
				this.searchContent.pageSize = pageSize;
				this.searchContent.currentPage = 1;
				this.getListData();
			},
			handleCurrentChange(page) {
				this.searchContent.currentPage = page;
				this.getListData();
            },
            getPackageListData() {
                var temp=[];
                for(var i=0;i<this.checkedCities.length;i++){
                    if(this.checkedCities.indexOf(this.checkedCities[i]) == i){
                    temp.push(this.checkedCities[i]);
                    }
                }
                var key=[];
                if(temp.length<13){
                    for(var j=0;j<13;j++){  
                        for(var i=0;i<temp.length;i++){
                            if(temp[i]==this.cities[j].label){
                                key.push(this.cities[j].value);
                                
                            }
                        }
                    }
                }
                console.log(key);
                const data = {};
                data.business_type = key;
                data.page = this.searchContent.currentPage;
                data.pageSize = this.searchContent.pageSize;
                data.pay_amount_start   = this.searchContent.userName;
                data.pay_amount_end = this.searchContent.userPhone;
                data.ordersn = this.searchContent.effective_day;
                data.ordersn_type  = this.searchContent.oder_state;                
                data.pay_order_state  = this.searchContent.cdkey_state;
                data.pay_type  = this.searchContent.payStatus;
                data.state = this.searchContent.signUpChannel;
                data.pay_channel = 2;
                if (this.searchContent.addTime) {
                    const startAddMS = this.searchContent.addTime[0].getTime();
                    const endAddMS = this.searchContent.addTime[1].getTime();
                    if (startAddMS == endAddMS) {
                        data.pay_time_start  = dateFormatter('YYYY-MM-DD ', startAddMS);
                        data.pay_time_end  = dateFormatter('YYYY-MM-DD ', endAddMS + (24 * 60 * 60 - 1) * 1000);
                    } else {
                        data.pay_time_start = dateFormatter('YYYY-MM-DD ', this.searchContent.addTime[0]);
                        data.pay_time_end  = dateFormatter('YYYY-MM-DD ', this.searchContent.addTime[1]);
                    }
                }
                console.log("data",data);
                this.$http.post('/admin/bill/index.php?act=reconciliation&op=setPackage', data).then(res => {
                    this.$router.push(`/home/operate-panel/pay-check/group-management`) ;
                })
},
			getListData() {
                // var temp=[];
                // for(var i=0;i<this.checkedCities.length;i++){
                //     if(this.checkedCities.indexOf(this.checkedCities[i]) == i){
                //         temp.push(this.checkedCities[i]);
                //     }
                // }
                // var key=[];
                // if(temp.length<13){
                //     for(var j=0;j<13;j++){  
                //         for(var i=0;i<temp.length;i++){
                //         if(temp[i]==this.cities[j].label){
                //             key.push(this.cities[j].value);
                            
                //             }
                //         }
                //     }
                // }
                console.log(this.checkedCities);
                const data = {};
                data.business_type = this.checkedCities;
                data.page = this.searchContent.currentPage;
                data.pageSize = this.searchContent.pageSize;
                data.pay_amount_start   = this.searchContent.userName;
                data.pay_amount_end = this.searchContent.userPhone;
                data.ordersn = this.searchContent.effective_day;
                data.ordersn_type  = this.searchContent.oder_state;
                data.pay_channel = 2;
                if(data.ordersn &&data.ordersn_type==undefined){
                    this.$message({
                        showClose: true,
                        message: '请选择订单类型',
                        type: 'error'
                    }); 
                    return;                    
                }                
                data.pay_order_state  = this.searchContent.cdkey_state;
                data.pay_type  = this.searchContent.payStatus;
                data.state = this.searchContent.signUpChannel;
                if (this.searchContent.addTime) {
                    const startAddMS = this.searchContent.addTime[0].getTime();
                    const endAddMS = this.searchContent.addTime[1].getTime();
                    if (startAddMS == endAddMS) {
                        data.pay_time_start  = dateFormatter('YYYY-MM-DD ', startAddMS);
                        data.pay_time_end  = dateFormatter('YYYY-MM-DD ', endAddMS + (24 * 60 * 60 - 1) * 1000);
                    } else {
                        data.pay_time_start = dateFormatter('YYYY-MM-DD ', this.searchContent.addTime[0]);
                        data.pay_time_end  = dateFormatter('YYYY-MM-DD ', this.searchContent.addTime[1]);
                    }
                }
                console.log("data",data);
                this.$http.post('/admin/bill/index.php?act=reconciliation&op=index', data).then(res => {
                    if (res.code == 1) {
                        if (res.data && res.data.list.length) {
                            this.signUpInfoList = res.data.list;
                            // this.signUpInfoList = res.data.list.map(function(item) {
                            //     return {
                            //         ordersn: item.ordersn,
                            //         amount: item.amount,
                            //         pay_ordersn: item.pay_ordersn,
                            //         pay_time: item.pay_time,
                            //         poundage: item.poundage,
                            //         poundage_rate: item.poundage_rate,
                            //         package_id: item.package_id,
                            //         store_name: item.store_name,
                            //         pay_type_name: item.pay_type_name,
                            //         state_name: item.state_name,
                            //         pay_order_state_name:item.pay_order_state_name,
                            //         business_type_name: item.business_type_name,
                            //         third_amount: item.third_amount*1000,
                            //         is_ok_manual:item.is_ok_manual,
                            //         // uc_verify: item.uc_verify,
                            //         // qq_work: item.qq_work,
                            //         // internal_settlement: item.internal_settlement,
                            //         // uc_member_id: item.uc_member_id,
                                    
                            //     }
                            // });
                            this.total = parseInt(res.data.totalCount);
                            
                        } else {
                            this.signUpInfoList = [];
                            this.total = 0;
                        }
                    }
                    else if (res.code == 2001) {
                        this.signUpInfoList = [];
                        this.total = 0;
                    }
                    else {
                        
                        alert(res.msg);
                    }
                })
            },
            //导出打款清单
            exportLink() {
                const data = {};
                data.business_type = this.checkedCities;
                data.page = this.searchContent.currentPage;
                data.pageSize = this.searchContent.pageSize;
                data.pay_amount_start   = this.searchContent.userName;
                data.pay_amount_end = this.searchContent.userPhone;
                data.ordersn = this.searchContent.effective_day;
                data.ordersn_type  = this.searchContent.oder_state;
                data.pay_channel = 2;
                if(data.ordersn &&data.ordersn_type==undefined){
                    this.$message({
                        showClose: true,
                        message: '请选择订单类型',
                        type: 'error'
                    }); 
                    return;                    
                }                
                data.pay_order_state  = this.searchContent.cdkey_state;
                data.pay_type  = this.searchContent.payStatus;
                data.state = this.searchContent.signUpChannel;
                if (this.searchContent.addTime) {
                    const startAddMS = this.searchContent.addTime[0].getTime();
                    const endAddMS = this.searchContent.addTime[1].getTime();
                    if (startAddMS == endAddMS) {
                        data.pay_time_start  = dateFormatter('YYYY-MM-DD ', startAddMS);
                        data.pay_time_end  = dateFormatter('YYYY-MM-DD ', endAddMS + (24 * 60 * 60 - 1) * 1000);
                    } else {
                        data.pay_time_start = dateFormatter('YYYY-MM-DD ', this.searchContent.addTime[0]);
                        data.pay_time_end  = dateFormatter('YYYY-MM-DD ', this.searchContent.addTime[1]);
                    }
                }
                data.is_export = 1;
                data.list_type = 2;
                let domain = document.domain;
                if (domain != 'admin.mycjj.com' && domain != 'admin.chejj.cn') {
                    domain = 'admin.chejj.cn'
                }                
                var url = location.protocol + '//' + domain.replace('admin', 'api') + '/admin/bill/index.php?act=reconciliation&op=index';

                for (var key in data) {
                        // if(key=='business_type'){
                        //    console.log(data[key]);
                        // }
                        if (!(data[key] === null || data[key] === "" || data[key] === undefined)){
                            if(key=='business_type'){
                               for(var i  in data['business_type']){
                                   url += "&business_type[" + i + "]=" + data['business_type'][i];
                               }
                            }else{
                               url += "&" + key + "=" + data[key];
                            }
                               
                        }
                    }    
                console.log(url);    
                window.location.href = url;             
                // let domain = document.domain;
                // if (domain != 'admin.mycjj.com' && domain != 'admin.chejj.cn') {
                //     domain = 'admin.chejj.cn'
                // }
                // console.log(data);
                // return location.protocol + '//' + domain.replace('admin', 'api') + '/admin/bill/index.php?act=reconciliation&op=index&' + Qs.stringify(data);
            },   
            //onlyexport导出
            onlyexport(){
                const data = {};
                data.business_type = this.checkedCities;
                data.page = this.searchContent.currentPage;
                data.pageSize = this.searchContent.pageSize;
                data.pay_amount_start   = this.searchContent.userName;
                data.pay_amount_end = this.searchContent.userPhone;
                data.ordersn = this.searchContent.effective_day;
                data.ordersn_type  = this.searchContent.oder_state;
                data.pay_channel = 2;
                if(data.ordersn &&data.ordersn_type==undefined){
                    this.$message({
                        showClose: true,
                        message: '请选择订单类型',
                        type: 'error'
                    }); 
                    return;                    
                }                
                data.pay_order_state  = this.searchContent.cdkey_state;
                data.pay_type  = this.searchContent.payStatus;
                data.state = this.searchContent.signUpChannel;
                if (this.searchContent.addTime) {
                    const startAddMS = this.searchContent.addTime[0].getTime();
                    const endAddMS = this.searchContent.addTime[1].getTime();
                    if (startAddMS == endAddMS) {
                        data.pay_time_start  = dateFormatter('YYYY-MM-DD ', startAddMS);
                        data.pay_time_end  = dateFormatter('YYYY-MM-DD ', endAddMS + (24 * 60 * 60 - 1) * 1000);
                    } else {
                        data.pay_time_start = dateFormatter('YYYY-MM-DD ', this.searchContent.addTime[0]);
                        data.pay_time_end  = dateFormatter('YYYY-MM-DD ', this.searchContent.addTime[1]);
                    }
                }
                data.is_export = 1;
                data.list_type = 3;
                let domain = document.domain;
                if (domain != 'admin.mycjj.com' && domain != 'admin.chejj.cn') {
                    domain = 'admin.chejj.cn'
                }                
                var url = location.protocol + '//' + domain.replace('admin', 'api') + '/admin/bill/index.php?act=reconciliation&op=index';

                for (var key in data) {
                        // if(key=='business_type'){
                        //    console.log(data[key]);
                        // }
                        if (!(data[key] === null || data[key] === "" || data[key] === undefined)){
                            if(key=='business_type'){
                               for(var i  in data['business_type']){
                                   url += "&business_type[" + i + "]=" + data['business_type'][i];
                               }
                            }else{
                               url += "&" + key + "=" + data[key];
                            }
                               
                        }
                    }    
                console.log(url);    
                window.location.href = url;             
                //                
            },         
            reconcide(){
                const data = {};
                data.business_type = this.checkedCities;
                data.page = this.searchContent.currentPage;
                data.pageSize = this.searchContent.pageSize;
                data.pay_amount_start   = this.searchContent.userName;
                data.pay_amount_end = this.searchContent.userPhone;
                data.ordersn = this.searchContent.effective_day;
                data.ordersn_type  = this.searchContent.oder_state;
                data.pay_channel = 2;
                if(data.ordersn != undefined && data.ordersn_type==undefined){
                    this.$message({
                        showClose: true,
                        message: '请选择订单类型',
                        type: 'error'
                    }); 
                    return;                    
                }                
                data.pay_order_state  = this.searchContent.cdkey_state;
                data.pay_type  = this.searchContent.payStatus;
                data.state = this.searchContent.signUpChannel;
                if (this.searchContent.addTime) {
                    const startAddMS = this.searchContent.addTime[0].getTime();
                    const endAddMS = this.searchContent.addTime[1].getTime();
                    if (startAddMS == endAddMS) {
                        data.pay_time_start  = dateFormatter('YYYY-MM-DD ', startAddMS);
                        data.pay_time_end  = dateFormatter('YYYY-MM-DD ', endAddMS + (24 * 60 * 60 - 1) * 1000);
                    } else {
                        data.pay_time_start = dateFormatter('YYYY-MM-DD ', this.searchContent.addTime[0]);
                        data.pay_time_end  = dateFormatter('YYYY-MM-DD ', this.searchContent.addTime[1]);
                    }
                }   
                this.$http.post('/admin/bill/index.php?act=reconciliation&op=reconciliation', data).then(res => {
                    if (res.code == 1) {
                        this.$message({
                            showClose: true,
                            message: res.msg,
                            type: 'success'
                        }); 
                    }else {
                        this.$message({
                            showClose: true,
                            message: res.msg,
                            type: 'error'
                        }); 
                    }
                })                             
            },
            // 读取excel
            getBusinessTypes(){
                this.$http.post('/admin/bill/index.php?act=reconciliation&op=getBusinessTypes').then(res => {
                        if (res.code == 1) {
                            this.cities=res.data;
                            console.log(this.list);
                            // resize(this);
                            this.$nextTick(() => {
                                var ch = document.documentElement.clientHeight || document.body.clientHeight;
                                console.log($(".search-content").css("height"))
                                this.oHeight = ch - 50 - 41 - 20  - (parseInt($(".search-content").css("height")) || 20) - (parseInt($(".paginationOne").css("height")) || 0);
                            })
                        }
                        
                        else {
                        
                            alert(res.msg);
                        }
                    })
            },
        },
       
		mounted() {
            // resize(this);
            // this.$nextTick(() => {
            //     var ch = document.documentElement.clientHeight || document.body.clientHeight;
            //     console.log($(".search-content").css("height"))
            //     this.oHeight = ch - 50 - 41 - 20 - 40  - (parseInt($(".search-content").css("height")) || 20) - (parseInt($(".paginationOne").css("height")) || 0);
            // })
            window.onresize = () => {
                this.$nextTick(() => {
                    var ch = document.documentElement.clientHeight || document.body.clientHeight;
                    this.oHeight = ch - 50 - 41 - 20  - (parseInt($(".search-content").css("height")) || 20) - (parseInt($(".paginationOne").css("height")) || 0);
                })
            }
		},
		created() {
			if (this.$parent.tabLists[1] && this.$parent.tabLists[1].name == "打款过账") {
				this.$parent.tabLists.splice(1, 1);
            }
            this.getListData();
            this.getBusinessTypes();
            this.getPaystate();
		},
		name: "sign-up-info"
	}
</script>

<style lang="scss" scoped>
 
    .sign-up-info {
        .search-content {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            &-input {
                width: 200px;
            }
            .time-range-wrapper {
                .time-range-label {
                    font-size: 14px;
                }
                display: flex;
                align-items: center;
                /deep/.el-range-separator {
                    box-sizing: content-box;
                }
            }
        }
        .bottom {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
    }
    .upload-demo /deep/.el-upload-list{
        display: none;
    }
    .btn-bottom {
        background: #409EFF;
        color: #fff;
        border: 0;
        font-size: 14px;
        padding: 5px 8px;
        border-radius: 3px;
        display: inline-block;
    }
</style>